{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item" >

                        <div class="layui-input-inline" style="margin-top: 5px;">
                            <input type="text"  name="apply_start_time" onfocus="wk.lay_date1(this);" class="layui-input layer-date search" placeholder="报名开始时间"/>
                        </div>

                        <div class="layui-input-inline" style="margin-top: 5px;">
                            <input type="text"  name="apply_end_time" onfocus="wk.lay_date1(this);"  class="layui-input layer-date search" placeholder="报名结束时间"/>
                        </div>

                        <!--<div class="layui-col-md6 layui-input-inline" style="margin-top: 5px;">-->
                            <!--<input type="text" id="user_keyword" class="layui-input search" name="user_keyword" placeholder="手机号/ID/姓名"/>-->
                        <!--</div>-->

                        <!--<div class="layui-col-md6 layui-input-inline" style="margin-top: 5px;">-->
                            <!--<input type="text" id="match_keyword" class="layui-input search" name="match_keyword" placeholder="赛事ID/名称"/>-->
                        <!--</div>-->

                        <!--<div class="layui-col-md6 layui-input-inline" style="margin-top: 5px;">-->
                            <!--<select name="user_gender" lay-search="">-->
                                <!--<option  value="">不限性别</option>-->
                                <!--<option  value="1">男</option>-->
                                <!--<option  value="2">女</option>-->
                            <!--</select>-->
                        <!--</div>-->

                        <div class="layui-col-md6 layui-input-inline" style="margin-top: 5px;">
                            <select name="ma_sgin_status" lay-search="">
                                <option  value="">不限签到状态</option>
                                <option  value="1">未签到</option>
                                <option  value="2">已签到</option>
                            </select>
                        </div>

                        <div class="layui-col-md6 layui-input-inline" style="margin-top: 5px;">
                            <select name="ma_baodao_status" lay-search="">
                                <option  value="">不限报到状态</option>
                                <option  value="1">未报到</option>
                                <option  value="2">已报到</option>
                            </select>
                        </div>

                        <div class="layui-input-inline"  style="margin-top: 5px;">
                            <select name="club_id" lay-search="">
                                <option  value="">不限代表队</option>
                                {foreach name="club" item="vo" key="key"}
                                <option  value="{$vo['club_id']}">{$vo['club_name']}</option>
                                {/foreach}
                            </select>
                        </div>

                        <div class="layui-input-inline" style="margin-top: 5px;">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                    </div>
                </div>
                <!--操作框开始-->

                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="testReload"></table>

                    <!--图片模板-->
                    <!--<script type="text/html" id="imgTpl">-->
                        <!--<img src="{{d.banner_thumb}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"/>-->
                    <!--</script>-->

                    <!--状态显示模板-->
                    <script type="text/html" id="boatType">
                        {{# if(d.ma_boat_type == 1){ }}
                        1x
                        {{# } }}
                        {{# if(d.ma_boat_type == 2){ }}
                        2-
                        {{# } }}
                        {{# if(d.ma_boat_type == 3){ }}
                        2+
                        {{# } }}
                        {{# if(d.ma_boat_type == 4){ }}
                        4-
                        {{# } }}
                        {{# if(d.ma_boat_type == 5){ }}
                        4+
                        {{# } }}
                        {{# if(d.ma_boat_type == 6){ }}
                        4x
                        {{# } }}
                        {{# if(d.ma_boat_type == 7){ }}
                        2x
                        {{# } }}
                        {{# if(d.ma_boat_type == 8){ }}
                        8+
                        {{# } }}
                    </script>

                    <script type="text/html" id="sginStatus">
                        {{# if(d.ma_sgin_status == 1){ }}
                        未签到
                        {{# } }}
                        {{# if(d.ma_sgin_status == 2){ }}
                        已签到
                        {{# } }}
                    </script>


                    <script type="text/html" id="baodaoStatus">
                        {{# if(d.ma_baodao_status == 1){ }}
                        未报到
                        {{# } }}
                        {{# if(d.ma_baodao_status == 2){ }}
                        已报到
                        {{# } }}
                    </script>

                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        {{# if(d.match_status == 1){ }}
                        <a href="javascript:;" onclick="wk.href('{:url('applyEdit')}?ma_id={{d.ma_id}}')" class="btn btn-warning btn-xs m-r-xs" title="编辑">编辑</a>
                        {{# } }}
                        <a href="javascript:;" onclick="wk.layer_show('船员','{:url('member')}?ma_id={{d.ma_id}}')" class="btn btn-warning btn-xs m-r-xs" title="船员">船员</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Rowingmember/index")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
//                  {type: 'checkbox', fixed: 'left'}
                  {type:'numbers', width: '', title: '序号'}
//                , {field: 'match_id', width: 80, title: 'ID', align: 'center'}
                , {field: 'club_name', width: 180, title: '代表队名称', align: 'center'}
                , {field: 'mg_name', width: 140, title: '组别', align: 'center'}
                , {field: 'ma_lingd', width: 100, title: '领队', align: 'center'}
                , {field: 'ma_team_name', width: '', title: '队名', align: 'center'}
                , {field: 'ma_distance', width: 90, title: '赛道距离', align: 'center'}
                , {field: 'ma_boat_type', width: 60, title: '船型', align: 'center', toolbar: '#boatType'}
                , {field: 'ma_total_price', width: 110, title: '报名费用', align: 'center'}
                , {field: 'ma_date', width: 120, title: '报名时间', align: 'center'}
                , {field: 'ma_sgin_status', width: 90, title: '签到状态', align: 'center', toolbar: '#sginStatus'}
                , {field: 'ma_baodao_status', width: 90, title: '报到状态', align: 'center', toolbar: '#baodaoStatus'}
                , {fixed: 'right', width: 180, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.img-circle').viewer({
                    url: 'data-original',
                });
            }
        });
        var getIds = function () {
            var ids = [];
            var checkStatus = table.checkStatus('testReload')
                    ,data = checkStatus.data;
            $.each(data,function(index,item){
                ids.push(item['ma_id'])
            });
            return ids;
        }
    });
</script>
</body>
</html>